
export enum PLAY_MODE {
  STRAIGHT = 'STRAIGHT',
  SINGLE = 'SINGLE',
  LOOP = 'LOOP'
}

export enum PlayerStatus {
  PLAYING = 'PLAYING',
  Paused = 'PAUSED',
  STOPPED = 'STOPPED',
  ERROR = 'ERROR'
}

export enum EndReason {
  COMPLETE = 'COMPLETE',
  ERROR = 'ERROR',
  MANUAL = 'MANUAL'
}

export type PlayerState<ResourceT> = {
  title: string;
  extra: Record<string, any>;
  startUrl: string;
  startIndex: number;
  endIndex: number;
  nextIndex: number;
  errorIndex: number;
  doneIds: string[];
  loopsCursor: number;
  loopsStart: number;
  loopsEnd: number;
  playUID: number;
  breakpoints: number[];
  callback: Function;
  public: Record<string, any>;
  lastPlayConfig: Record<string, any>;
  resources: ResourceT[];
  status: PlayerStatus;
  mode: PLAY_MODE;
  postDelay?: number;
}

export enum END_REASON {
  COMPLETE = "COMPLETE",
  ERROR = "ERROR",
  MANUAL = "MANUAL",
};

export enum NEXT_INDEX_INITIATOR {
  INIT = "INIT",
  NORMAL = "NORMAL",
  LOOP = "LOOP",
};